﻿@{   
    string results = "";
    string query = "";
    if (this.Request.Form["ButtonQuery"] == "Execute")
    {
        query = this.Request.Form["TextBoxQuery"];
        results = MyModel.mySqlQuery.Query(query);
    }

    Page.Title = "Laos Traveller";
    Layout = "LaosLayout.cshtml"; 
}
<h1>
    Laos Traveller - SQL Query</h1>
<br />
<form name="form1" method="post" action="sqlquery.cshtml" id="form1">
<span id="Label1" style="display: inline-block; width: 50px;">Query:</span>
<textarea name="TextBoxQuery" rows="2" cols="20" id="TextBoxQuery" style="height: 300px;
    width: 500px;">@query</textarea>
<br />
<br />
<input type="submit" name="ButtonQuery" value="Execute" id="ButtonQuery" />
<br />
<br />
<span id="Label2" style="display: inline-block; width: 50px;">Result:</span>
<textarea name="TextBoxResults" rows="2" cols="20" id="TextBoxResults" style="height: 300px;
    width: 500px;">@results</textarea>
</form>
